package com.abbas.CayTcore.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.abbas.CayTcore.databinding.WarmingItemBinding
import com.abbas.CayTcore.entity.vo.InfoVO

class InfoAdapter(var data: MutableList<InfoVO> = mutableListOf()) : RecyclerView.Adapter<InfoAdapter.InfoViewHolder>() {

    private var binding: WarmingItemBinding? = null

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): InfoViewHolder {
        binding = WarmingItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)
        return InfoViewHolder(binding!!.root)
    }

    override fun onBindViewHolder(holder: InfoViewHolder, position: Int) {
        binding?.let {
            it.infoTv.text = data[position].info
        }
    }

    override fun getItemCount(): Int {
        return data.size
    }

    inner class InfoViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {


    }

}